Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Switch to a single routability event #126

Merged
merged 2 commits into from
Mar 5, 2020

Conversation

Stebalien
Copy link
Member

@Stebalien Stebalien commented Mar 4, 2020

Notes/Questions:

  • Should we call this "reachability" instead of "routability"?
  • I've put the constants inside the network package for lack of a better place. I assume we'll want to use them elsewhere. For example, we may eventually want the host to answer the question "do I think this peer can be reached from the public internet?"
  • Eventually, we'll want something more complex than public/private. We can extend the event when that happens.

This means we can make the event _stateful_ so subscribing always gives us the
last state.
@@ -53,6 +53,24 @@ const (
CannotConnect
)

// Routability indicates how reachable a node is.
type Routability int
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worth making this a byte?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@willscott What's the advantage of making this a byte ? Saving space ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@willscott What's the advantage of making this a byte ? Saving space ?

Right. Could potentially allow for better packing

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd support it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No real reason not to.

Copy link
Member Author

@Stebalien Stebalien Mar 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, well, except for consistency with Connectedness, Direction, and most other enums.

event/routability.go Outdated Show resolved Hide resolved
@aarshkshah1992
Copy link
Contributor

@Stebalien I like "reachability" more than "routability". Makes the concept more readable & understandable.

Copy link
Member

@raulk raulk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to "reachability". It's probably the -ability that I was shooting for, but my mind was fried when this code was written.

event/routability.go Outdated Show resolved Hide resolved
@@ -53,6 +53,24 @@ const (
CannotConnect
)

// Routability indicates how reachable a node is.
type Routability int
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd support it.

@aschmahmann
Copy link
Contributor

@Stebalien anything preventing this from being merged?

@@ -53,6 +53,25 @@ const (
CannotConnect
)

// Reachability indicates how reachable a node is.
type Reachability int
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for clarification is the reason we're put the enum in the network package instead of the event package because we're hoping reachability will be more general than just the EvtLocalReachabilityChanged event?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Basically, it's not specific to the event itself.

@Stebalien Stebalien merged commit d143201 into master Mar 5, 2020
@Stebalien Stebalien deleted the feat/single-routability-event branch March 5, 2020 05:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants